import request from '@/utils/request'

export function getCarByPage(data) {
  return request({
    url: '/car',
    params: { ...data }
  })
}

export function getCarById(id) {
  return request({
    url: `/car/${id}`,
  })
}

export function addCar(data) {
  return request({
    url: '/car',
    method: 'post',
    data: data
  })
}

export function updateCarById(data) {
  return request({
    url: `/car`,
    method: 'put',
    data: data
  })
}

export function deleteCar(id) {
  return request({
    url: `/car/${id}`,
    method: 'delete',
  })
}

export function batchDeleteCar(idList) {
  return request({
    url: `/car/batchDelete`,
    method: 'post',
    data: idList
  })
}

export function getMyCar() {
  return request({
    url: `/car/getMyCar`,
    method: 'get'
  })
}


